1. Field of the Invention
The present invention relates to a write-protected disk caching device and process for mass storage subsystem hard disks. This device and this process can also be used individually on a computer hard disk.
2. Description of Related Art
A hard disk drive (1) of the prior art, represented by FIG. 3A, is essentially constituted by a magnetic medium (10), means for reading and writing (11) on this magnetic medium linked to a volatile memory (13), called a xe2x80x9ccache memoryxe2x80x9d by one skilled in the art, which will hereinafter be called a disk cache. The hard disk drive is linked to a host system (3) by an interface (12) and by a bus (2) between the interface and a bus adapter circuit (30) (host bus adapter: HBA) of the host system (3). The adapter circuit (30) makes it possible to connect the bus of the host system (3) to the SCSI bus (2) and is controlled by a connection driver. The system (3) itself may be equipped with a cache memory called a system cache. A disk normally operates in the following way. First, the user of the system can access the data present on the disk, either through a write operation or a read operation.
When the system sends a read command to the disk drive comprising, for example, the number of the first block to be read and the total number of blocks to be read, the disk drive that receives this command through the interface searches for the data, reads it, and puts it in the disk cache. Once the information is in the cache, the disk drive sends a message to the system to indicate that the data is ready to be sent. The system responds with a command for initiating the sending of the data.
The write operation starts by putting the data to be written into the system cache, after which the system sends a write command to the disk drive. When the disk drive is ready to receive the data, it informs the system, which then transmits the data to the disk drive, passing through the adapter (HBA), the SCSI bus, then the disk drive interface. The data received by the disk drive is then stored in the disk cache. Then, the disk drive performs the actual writing of the data from the cache onto the magnetic medium (10). Once the writing, as well as any possible write verification and/or error correction operation is finished, the disk drive sends a message xe2x80x9cFIN OKxe2x80x9d through the interface to indicate to the system that the disk is again ready to receive data. This write procedure effectively preserves the integrity of the data, since as long as the data has not actually been written onto the magnetic medium, the disk drive does not send the message xe2x80x9cFIN OK,xe2x80x9d and therefore the system maintains the data in its system cache. Thus, even if some type of failure occurs during the writing onto the magnetic medium, for example due to a malfunction of the disk drive or an electric power failure, the message xe2x80x9cFIN OKxe2x80x9d will not be sent, but the data will be saved in the system cache.
However, it is clear that this procedure inhibits the system and thus slows down its operations until the write operation is finished, i.e., until the message xe2x80x9cFIN OKxe2x80x9d is sent by the disk drive.
In the prior art, there are known possibilities for improving the performance of a disk. First, the performance of the disk can be increased by modifying the architecture of the disk. However, this solution is very expensive and can only be implemented by disk manufacturers.
The read performance can be improved by sending the cache of the disk more data (for example one page) than what is requested by the system. Thus, when the system subsequently requests other data from the page stored in the cache, it will already be present in the cache of the disk, and can be accessed faster by the system.
The write performance of the disk drive can be improved by actually using the cache of the disk to mask an operation. For this reason, a functionality called a write cache function, which already exists in the disks of the prior art, consists of sending the message xe2x80x9cFIN OKxe2x80x9d as soon as the data transmitted by the system is in the cache of the disk. Thus, the write operation is performed during the sending of the next data, resulting in a substantial increase in performance. However, this technique has the major drawback of not preserving the integrity of the data.
In fact, in certain types of incidents, the data will not be written or will be only partially written onto the disk, without its being possible to recover the lost data. For example, if a failure of the electric power supply of the disk drive occurs after the message xe2x80x9cFIN OKxe2x80x9d has been sent by the disk drive to the system, but before the complete writing of the data from the disk cache onto the magnetic medium, this data will be lost. In fact, the disk cache being volatile memory, the data are erased as soon as the disk cache is no longer supplied with electricity. Since the message xe2x80x9cFIN OKxe2x80x9d has been sent by the disk drive and received by the system, the system has dumped its system cache in order to store the data of the next write operation and it no longer has the data that had been in the disk cache. This drawback is all the more critical in that it can occur unnoticed, for example when the power failure is of very short duration (micro-interruption). Thus, not only is the data permanently lost, but this lost goes undetected by the system. This major drawback in the use of the disk cache in writing expressly prohibits the use of the cache as described above when the integrity of the data must be preserved.
There are other solutions that use the caching function for writing, but they are costly and complex, since they require the use of a controller function or the use of an additional cache as well as its management and protection.
Hence the object of the present invention is to eliminate the drawbacks of the prior art by offering a device that makes it possible to use the disk cache function for writing in order improve the write performance of a disk, without the risk of a data loss.
This object is achieved through the fact that the write-protected disk caching device comprises a host system linked by an adapter (host bus adapter) of the host system to a bus, an interface and at least one hard disk drive, means for supplying backup power for a given duration, and at least one main device for supplying electric power to the disk drive comprising means for monitoring at least the backup [note: claim 1] electric power supply means and the main power supply devices, the device being characterized in that the monitoring means can be interrogated by interrogation means of the host system so that the latter can enable the write disk cache function, or not, in the write commands to be sent to the disk drives, in accordance with the information gathered by the monitoring means.
According to another characteristic, the information gathered by the monitoring means represents the operating state of the main power supplies and of the backup power supply means.
According to another characteristic, the write disk cache function is enabled by the host system in the write commands as long as the main power supplies and the backup power [note: claim 3] supply means are operational.
According to another characteristic, the host system initiates the writing of the data contained in all the disk caches onto the respective magnetic disks as soon as the information gathered by the monitoring means indicates that the main power supplies or the backup power supply means have failed.
According to another characteristic, the interrogation means comprise an agent installed at a level higher than that of the connection driver of the host system adapter, which agent performs a polling of the monitoring means at a given time interval and sets a flag indicating whether or not the write disk cache function is authorized, this flag being consulted by the connection driver of the host system before each sending of a write command to a disk.
According to another characteristic, the period during which the power supply means must allow the proper functioning of the computer system corresponds to at least the time required for the data contained in each disk cache of a disk drive to be written onto the magnetic medium, plus the time lapse corresponding to the given monitoring interval between two interrogations of the monitoring means.
According to another characteristic, the device comprises an integrated circuit that monitors the backup electric power supply means and each main electric power supply device and that sends through the bus an interface signal for denying the bus""s access to the host system during a given period so that no further command is transmitted to the disk drives.
A second object of the invention consists of offering a write-protected disk caching process that eliminates the drawbacks of the prior art.
This second object is achieved through the fact that the write-protected disk caching process of a computer system comprising at least one hard disk drive fed by at least one main electric power supply device and means for supplying backup power for a given duration, a host system linked by an adapter of the host system (host bus adapter), a bus to at least the disk drive and means for monitoring at least the electric power supply means and the main power supplies, characterized in that it comprises:
a step for monitoring the backup power supply means and each electric power supply device,
a step for indicating the state of the backup power supply means and of each electric power supply device,
if the backup power supply means and the two electric power supply devices are all operational, the process comprises a step for enabling the write disk cache function; if not, the process comprises a backup step comprising a step for disabling the write disk cache function and a step for writing the data contained in the disk caches of the disk drives onto the magnetic media of the disk drives.